<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="__STATIC__/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="__STATIC__/jquery-2.1.3.js"></script>
<script src="__STATIC__/bootstrap/js/bootstrap.min.js"></script>
<css file='__ADMIN_PUBLIC__/css/public.css' />
<style>
body{font-family:'微软雅黑'}
a{cursor:pointer;padding:3px 3px;}
.mt20{margin-top:20px;}
.nav.nav-tabs li{margin:0;padding:0;}
.nav.nav-tabs li a{font-size:16px;font-weight:bold;}
.nav.nav-pills li a{padding:6px 12px;}
.fs16{font-size:16px;}
.fr{float:right;}
.page span{padding:3px 6px;}
.handle a {border-right: 1px solid #bbb; padding: 0 6px;}
</style>
</head>
<body>
    <div class="col-md-12">
    	<h3>轮播活动列表</h3>
    	<div class="col-md-12">
	        <form action="{:U('/Admin/Activity/lact_list')}" method="post">
		        <input type="hidden" value="{$status}" name="status" />
	        </form>
	    </div>
	    <ul class="nav nav-tabs text-center" id="nav">
            <li class="col-md-2 "><a <eq name="status" value="1">class="btn-info"</eq> href="{:U('/Admin/Activity/lact_list', array('status' => 1))}">进行中</a></li>
            <li class="col-md-2"><a <eq name="status" value="3">class="btn-info"</eq> href="{:U('/Admin/Activity/lact_list', array('status' => 3))}">未开始</a></li>
            <li class="col-md-2"><a <eq name="status" value="2">class="btn-info"</eq> href="{:U('/Admin/Activity/lact_list', array('status' => 2))}">已结束</a></li>
        </ul>
    </div>
    
    <div class="col-md-12 mt20">
        <table class="table table-striped" style="text-align: center;">
            <tr>
            	<th style="width: 50px;">轮播顺序</th>
                <th>轮播图片</th>
                <th>开始时间</th>
                <th>结束时间</th>
                <th>跳转链接</th>
                <th style="padding-left: 14px;width: 15%;">操作</th>
                <if condition="$status eq 1"><th>轮播顺序更改</th></if>
            </tr>
            <notempty name="lbact">
            <foreach name='lbact' item='v'>
            <tr>
            	<td>{$v.numorder}</td>
                <td><img src="{$v.imgurl}" style="width: 200px;height: 100px;"></td>
                <td>{$v.atime|date='Y年m月d日',###}</td>
                <td>{$v.aetime|date='Y年m月d日',###}</td>
                <td style="width: 150px;word-break:break-all">{$v.acturl}</td>
                 <td>
                 	<a href="{:U('Activity/lact_info', array('id' => $v['id']))}">编辑</a>
                 	<if condition="$v.status eq 1">
                 		<a onclick="return confirm('确定要结束轮播?')" href="{:U('Activity/lact_soldout', array('id' => $v['id']))}">结束轮播</a>
                 	<else/>
                 		<a onclick="return confirm('确定要还原轮播?')" href="{:U('Activity/lact_soldout', array('id' => $v['id'],'status'=>1))}">还原轮播</a>
                 		<a onclick="return confirm('确定要删除该数据?')"  href="{:U('Activity/lact_delect', array('id' => $v['id']))}">删除</a>
                 	</if>
                 </td>
                 <if condition="($v.status eq 1) AND ($v.atime lt time()) AND ($v.aetime gt time())">
                 <td style="width: 100px;">
                 	<input id="{$v.id}" value="{$v.numorder}" name="numorder" class="form-control" style="margin-bottom: 5px;"/>
                 	<button class="btn btn-primary" onclick="update_umberorder({$v.id})">确定</button>
                 </td>
                 </if>
            </tr>
            </foreach>
            <else/>
            <tr>
            	<td colspan="10" class="text-center">暂无数据！！！</td>
            </tr>
            </notempty>
        </table>
    </div>
 <div class="text-center page">{$page}</div>
</body>
<script>
	function update_umberorder(id){
		var num = '#'+id;
		var numorder = $(num).val();
		$.post("{:U('Activity/update_umberorder')}",{id:id,numorder:numorder},function(res){
			if(res){
				window.location.reload();
			}
		});
	}
</script>
</html>